package com.ruipeng.utils;

/**
 * Created by tu_pei on 2017/6/22.
 */
public class Test {

    public static void main(String[] args){
//        String str = "{\"message\":\"\",\"code\":0,\"body\":{\"userId\":10019,\"role\":\"client\",\"jwt\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMDAxOSIsInJvbGUiOiJjbGllbnQiLCJpc3MiOiIzNWRmMGU5ZC05Y2IyLTQ2MjQtYjk5Yy1iZGRmYTFiOWJhOWUiLCJleHAiOjE0OTg3MjM2Mzh9.q5YX7aUb0nN13YvqgNHOuOsH_w0m7oV46kzB-EOSQpw\",\"userInfo\":{\"userId\":10019,\"nickname\":\"郭伟科123\",\"avatar\":\"https://img.acegear.com/363409024/w700\",\"background\":\"https://img.acegear.com/dc756c5e-2ed0-4dd0-a8ce-7ccf48bcf1b8/w700\",\"gender\":null,\"province\":\"北京\",\"title\":null,\"createAt\":1493966022751,\"updateAt\":1493975134709},\"userPhone\":{\"userId\":10019,\"phone\":\"18303721722\",\"verified\":true,\"createAt\":1493966022742,\"updateAt\":1493966022742},\"userEmail\":{\"userId\":10019,\"email\":null,\"verified\":false,\"createAt\":null,\"updateAt\":null},\"regist\":false}}";
//        JSONObject jsonObject = JSONObject.fromObject(str);
//        UserInfoTokenVO vo = (UserInfoTokenVO)JSONObject.toBean(jsonObject.getJSONObject("body"),UserInfoTokenVO.class);
//        System.out.println(vo);
        //System.out.print(jsonObject);
        //net.sf.json.JSONObject body = net.sf.json.JSONObject.fromObject(jsonObject.getJSONObject("body"));
        //System.out.println("---------------");
        //System.out.println(body.get("jwt"));
        //System.out.println(body.get("userId"));
        //System.out.println(body.get("role"));

        //net.sf.json.JSONObject userEmail = net.sf.json.JSONObject.fromObject(body.getJSONObject("userEmail"));
        //UserEmail emailJson = (UserEmail) net.sf.json.JSONObject.toBean(userEmail,UserEmail.class);
        //UserEmail email = net.sf.json.JSONObject.fromObject(net.sf.json.JSONObject.toBean(jsonObject.getJSONObject("userEmail")),UserEmail.class);
    }
}
